package com.sss.gsb.orm.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

@Entity
@Table(name="GSB_WS_LOAN_ACC_CLOSE_TN")
public class LoanAccountClosed implements Serializable {

	@Transient
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Transient
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		LoanAccountClosed other = (LoanAccountClosed) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 6351848526284727491L;

	@Id @Column(name="CIDTN")
	private BigDecimal id;
	
	@ManyToOne
	@JoinColumn(name="CID")
	private Loan loan;
	
	@Column(name="TRAN_DTNT")
	@Temporal(TemporalType.DATE)
	private Date transactionDate;
	
	@Column(name="BRCD")
	private Integer branchId  ;
	
	@Column(name="BRCD_NAME")
	private String branchName;
	
	@Column(name="EFFECT_DTNT")
	@Temporal(TemporalType.DATE)
	private Date effectDate;
	
	@Column(name="ENDBAL")
	private BigDecimal endBalance;
	
	@Column(name="TOTAL_AMT")
	private BigDecimal totalAmount;
	
	@Column(name="PRI_AMT")
	private BigDecimal primaryAmount;
	
	@Column(name="INT_AMT")
	private BigDecimal interest;
	
	@Column(name="PEN_AMT")
	private BigDecimal penaltyAmount;
	
	@Column(name="TRAN_CODE")
	private Integer transactionCode ;
	
	@Column(name="TRAN_NAME")
	private String transactionName;
	
	@Column(name="TRAN_TYPE")
	private Integer transactionType ;
	
	@Column(name="LOAN_TRAN_CODE")
	private Integer loanTransCode ;
	
	@Column(name="LOAN_TRAN_NAME")
	private String loanTransName;
	
	@Embedded RecordInfo recordInfo;

	public BigDecimal getId() {
		return id;
	}

	public void setId(BigDecimal id) {
		this.id = id;
	}

	public Loan getLoan() {
		return loan;
	}

	public void setLoan(Loan loan) {
		this.loan = loan;
	}

	public Date getTransactionDate() {
		return transactionDate;
	}

	public void setTransactionDate(Date transactionDate) {
		this.transactionDate = transactionDate;
	}

	public Integer getBranchId() {
		return (branchId == null)?0:branchId;
	}

	public void setBranchId(Integer branchId) {
		this.branchId = branchId;
	}

	public String getBranchName() {
		return branchName;
	}

	public void setBranchName(String branchName) {
		this.branchName = branchName;
	}

	public Date getEffectDate() {
		return effectDate;
	}

	public void setEffectDate(Date effectDate) {
		this.effectDate = effectDate;
	}

	public BigDecimal getEndBalance() {
		return endBalance;
	}

	public void setEndBalance(BigDecimal endBalance) {
		this.endBalance = endBalance;
	}

	public BigDecimal getTotalAmount() {
		return totalAmount;
	}

	public void setTotalAmount(BigDecimal totalAmount) {
		this.totalAmount = totalAmount;
	}

	public BigDecimal getPrimaryAmount() {
		return primaryAmount;
	}

	public void setPrimaryAmount(BigDecimal primaryAmount) {
		this.primaryAmount = primaryAmount;
	}

	public BigDecimal getInterest() {
		return interest;
	}

	public void setInterest(BigDecimal interest) {
		this.interest = interest;
	}

	public BigDecimal getPenaltyAmount() {
		return penaltyAmount;
	}

	public void setPenaltyAmount(BigDecimal penaltyAmount) {
		this.penaltyAmount = penaltyAmount;
	}

	public Integer getTransactionCode() {
		return (transactionCode == null)?0:transactionCode;
	}

	public void setTransactionCode(Integer transactionCode) {
		this.transactionCode = transactionCode;
	}

	public String getTransactionName() {
		return transactionName;
	}

	public void setTransactionName(String transactionName) {
		this.transactionName = transactionName;
	}

	public Integer getTransactionType() {
		return (transactionType == null)?0:transactionType;
	}

	public void setTransactionType(Integer transactionType) {
		this.transactionType = transactionType;
	}

	public Integer getLoanTransCode() {
		return (loanTransCode == null)?0:loanTransCode;
	}

	public void setLoanTransCode(Integer loanTransCode) {
		this.loanTransCode = loanTransCode;
	}

	public String getLoanTransName() {
		return loanTransName;
	}

	public void setLoanTransName(String loanTransName) {
		this.loanTransName = loanTransName;
	}

	public RecordInfo getRecordInfo() {
		return recordInfo;
	}

	public void setRecordInfo(RecordInfo recordInfo) {
		this.recordInfo = recordInfo;
	}
	
}
